@import '~@/assets/css/mixins';

.pro_tree_resize_box {
  height: 100%;
  border-right: 1px solid @gray-200;

  .ant-tree-title {
    width: 100%;
  }

  :global {
    .react-resizable {
      position: relative;
      background-clip: padding-box;
    }

    .react-resizable-handle {
      position: absolute;
      right: -5px;
      bottom: 0;
      z-index: 9;
      width: 20px;
      height: 100%;
      cursor: col-resize;
    }

    .icon-mianxingwenjianjiadakai,
    .icon-mianxingwenjianjiamoren {
      color: @gray-500;
    }

    .ant-spin-nested-loading {
      height: 100%;
    }

    .ant-spin-container {
      height: 100%;
    }
  }
}

.pro_tree_resize {
  height: 100%;

  .react-resizable-handle {
    right: -10px;
    width: 12px;
    height: 100%;
  }
}

.pro_tree {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 16px 0;
  overflow-y: auto;

  .pro_tree_name {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 20px;
    margin-bottom: 12px;
    padding: 0 16px;
    color: @gray-600;
    line-height: 20px;
    border-bottom: 1px solid @gray-200;

    .pro_tree_name_text {
      flex: 1;
      margin-bottom: 12px;
      font-size: @font-size-14;
    }

    .pro_tree_name_icons {
      margin-bottom: 12px;
      cursor: pointer;

      .iconfont {
        margin-left: 8px;
        color: rgb(0 0 0 / 45%);
      }
    }
  }

  // 搜索框
  .pro_tree_search {
    margin-bottom: 16px;
    padding: 0 12px;

    .ant-input {
      height: 28px;
      color: @white;
      background-color: transparent;
      border: 1px solid @gray-300;
    }

    .ant-input-search-icon,
    .ant-input-clear-icon {
      color: @gray-400;
    }
  }

  .pro_tree_main {
    flex: 1;
    padding: 0 12px;
    overflow-x: hidden;
    overflow-y: auto;

    :global {
      .ant-tree.ant-tree-directory .ant-tree-treenode::before {
        bottom: 0;
      }

      .ant-tree-treenode {
        padding: 4px 0;
      }

      .iconfont {
        font-size: 20px;
      }

      .iconfont-colour2 {
        font-size: 20px;
      }

      .ant-tree.ant-tree-directory .ant-tree-treenode-selected:hover::before,
      .ant-tree.ant-tree-directory .ant-tree-treenode-selected::before {
        background: @primary-sub-100;
      }

      .ant-tree.ant-tree-directory .ant-tree-treenode-selected .ant-tree-switcher {
        color: @gray-700;
      }

      .ant-tree.ant-tree-directory
        .ant-tree-treenode
        .ant-tree-node-content-wrapper.ant-tree-node-selected {
        color: @blue !important;
      }
    }
  }

  :global {
    .ant-tree.ant-tree-block-node .ant-tree-list-holder-inner .ant-tree-node-content-wrapper {
      display: flex;
      align-items: center;
      // width: calc(100% - 24px);
      width: 100%;
      overflow: hidden;
    }

    .ant-tree-title {
      display: flex;
      width: inherit;
      height: 26px;
      margin-left: 6px;
      overflow: hidden;
    }
  }
}

// 封装好的title
.pro_tree_title {
  display: flex;
  align-items: center;
  width: calc(100% - 16px);
  // justify-content: space-between;
  // color: @gray-700;

  .pro_tree_title_icon {
    align-items: center;
    justify-content: center;
    margin-right: 4px;
  }

  .pro_tree_title_text {
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    word-break: break-all;
  }

  .pro_tree_title_freeze {
    margin-right: 4px;
    margin-left: 4px;
  }

  .pro_tree_title_freeze1 {
    color: #ed4e47;
  }

  :global {
    .pro_tree_title_more {
      position: absolute;
      top: 4px;
      right: 0;
      font-size: 16px;
      // visibility: hidden;
    }
  }
}

// .pro_tree_title:hover {

//   :global {
//     .pro_tree_title_more {
//       visibility: visible;
//     }
//   }
// }

.pro_tree_title_popover {
  z-index: 1001;
  padding-left: 8px;
  overflow: hidden;
  border-radius: 2px;
  box-shadow: 2px 8px 20px rgb(2 17 30 / 8%);

  :global {
    .ant-popover-arrow {
      display: none;
    }

    .ant-popover-inner-content {
      padding: 4px 0;

      > a,
      > span {
        display: block;
        min-width: 120px;
        height: 28px;
        padding: 0 12px;
        color: @gray-600;
        line-height: 28px;

        &:hover {
          background: #d9ecff;
        }
      }
    }

    .ant-menu-vertical .ant-menu-item {
      min-width: 120px;
      height: 28px;
      margin-top: 0 !important;
      margin-bottom: 0 !important;
      padding: 0 12px !important;
      font-size: 12px !important;
      line-height: 28px;
    }
  }
}

.site_tree_search_value {
  color: #f50;
}
